package com.cvte.shop.service;

import com.cvte.csb.core.interfaces.vo.RestResponse;
import com.cvte.shop.entity.UniversalBasicCondition;
import com.cvte.shop.entity.UniversalDefinedCondition;
import com.cvte.shop.entity.UniversalTableConfig;
import com.cvte.csb.jdbc.mybatis.service.IBaseService;
import com.cvte.shop.entity.dto.ConditionDTO;
import com.cvte.shop.entity.dto.TableDTO;

import java.util.List;

/**
 * 服务类
 *
 * @author inv
 * @since 2020-08-04
 */
public interface UniversalTableConfigService extends IBaseService<UniversalTableConfig> {

    /**
     * 添加配置表的信息
     */
    RestResponse addTableConfig(TableDTO tableDTO);

    /**
     * 添加条件
     * @param conditionDTO
     * @return
     */
    RestResponse addCondition(ConditionDTO conditionDTO);

    /**
     * 根据条件拼接sql
     * @param builder
     * @param basicConditionList
     */
    boolean createBasicCondition(StringBuilder builder, List<UniversalBasicCondition> basicConditionList);

    /**
     * 根据条件拼接sql
     * @param builder
     * @param definedConditionList
     */
    void createDefinedCondition(StringBuilder builder, List<UniversalDefinedCondition> definedConditionList,boolean flag);

}
